package config.indoor.nexd.com.nexdmapconfig.ui.activity;

import android.content.Intent;

import java.util.Timer;
import java.util.TimerTask;

import config.indoor.nexd.com.nexdmapconfig.R;
import config.indoor.nexd.com.nexdmapconfig.presenter.LoadingPresenter;
import config.indoor.nexd.com.nexdmapconfig.ui.iView.ILoadingActivityView;

/**
 * Loading page
 * Created by wangxu on 16/2/24.
 */
public class LoadingActivity extends FullScreenActivity implements ILoadingActivityView {

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_loading;
    }

    @Override
    protected void initPresenter() {
        presenter = new LoadingPresenter(this, this);
        presenter.init();
    }

    @Override
    public void showToast(String message) {

    }

    @Override
    public void initView() {
        final Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                timer.cancel();
                LoadingActivity.this.startActivity(new Intent(LoadingActivity.this, SignInActivity.class));
                LoadingActivity.this.finish();
            }
        }, 3000);
    }
}
